package material.factory;

public class VeggiePizza02 extends Pizza02 {
    PizzaIngredientFactory pizzaIngredientFactory;

    public VeggiePizza02(PizzaIngredientFactory pizzaIngredientFactory) {
        this.pizzaIngredientFactory = pizzaIngredientFactory;
    }

    @Override
    void prepare() {
        //preare方法会一步一步的创建芝士披萨，每当需要什么材料只需向食料工厂去要即可
        System.out.println("正在准备：" + name);
        dough = pizzaIngredientFactory.createDough();
        sauce = pizzaIngredientFactory.createSauce();
        cheese = pizzaIngredientFactory.createCheese();
    }
}
